package com.journey.org.ui.custom.dialog

import android.os.Bundle
import androidx.fragment.app.FragmentActivity
import com.journey.org.BR
import com.journey.org.R
import com.journey.org.databinding.DialogAccountDetailBinding
import com.journey.org.entity.MineAccountEntity
import com.mvvmhabit.org.base.BaseDialog

class AccountDetailDialog(activity: FragmentActivity) :
    BaseDialog<DialogAccountDetailBinding, AccountDetailViewModel>(activity) {

    override fun initVariableId(): Int = BR.viewModel

    override fun initViewModel(): Class<AccountDetailViewModel> = AccountDetailViewModel::class.java

    override fun layoutId(savedInstanceState: Bundle?): Int = R.layout.dialog_account_detail

    fun showDialog(): AccountDetailDialog {
        show()
        return this
    }

    fun setEntity(entity: MineAccountEntity) {
        mViewModel?.onAccountDetailField?.set(entity)
    }
}